3.4 \(\int (a \cos (x)+b \sin (x)) \, dx\)

Optimal. Leaf size=10 \[ a \sin (x)-b \cos (x) \]

[Out]

-(b*Cos[x]) + a*Sin[x]

________________________________________________________________________________________

Rubi [A]  time = 0.00609, antiderivative size = 10, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {2637, 2638} \[ a \sin (x)-b \cos (x) \]

Antiderivative was successfully verified.

[In]

Int[a*Cos[x] + b*Sin[x],x]

[Out]

-(b*Cos[x]) + a*Sin[x]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int (a \cos (x)+b \sin (x)) \, dx &=a \int \cos (x) \, dx+b \int \sin (x) \, dx\\ &=-b \cos (x)+a \sin (x)\\ \end{align*}

Mathematica [A]  time = 0.0018502, size = 10, normalized size = 1. \[ a \sin (x)-b \cos (x) \]

Antiderivative was successfully verified.

[In]

Integrate[a*Cos[x] + b*Sin[x],x]

[Out]

-(b*Cos[x]) + a*Sin[x]

________________________________________________________________________________________

Maple [A]  time = 0.01, size = 11, normalized size = 1.1 \begin{align*} -b\cos \left ( x \right ) +a\sin \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a*cos(x)+b*sin(x),x)

[Out]

-b*cos(x)+a*sin(x)

________________________________________________________________________________________

Maxima [A]  time = 1.00208, size = 14, normalized size = 1.4 \begin{align*} -b \cos \left (x\right ) + a \sin \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*cos(x)+b*sin(x),x, algorithm="maxima")

[Out]

-b*cos(x) + a*sin(x)

________________________________________________________________________________________

Fricas [A]  time = 0.46018, size = 30, normalized size = 3. \begin{align*} -b \cos \left (x\right ) + a \sin \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*cos(x)+b*sin(x),x, algorithm="fricas")

[Out]

-b*cos(x) + a*sin(x)

________________________________________________________________________________________

Sympy [A]  time = 0.059447, size = 8, normalized size = 0.8 \begin{align*} a \sin{\left (x \right )} - b \cos{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*cos(x)+b*sin(x),x)

[Out]

a*sin(x) - b*cos(x)

________________________________________________________________________________________

Giac [A]  time = 1.13656, size = 14, normalized size = 1.4 \begin{align*} -b \cos \left (x\right ) + a \sin \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*cos(x)+b*sin(x),x, algorithm="giac")

[Out]

-b*cos(x) + a*sin(x)